/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
// paniprmt.hpp - An animated prompt widget
//
// Author: Jarret M. Gill
//
// Copyright (c) 1997-2005 Swell Software
//              All Rights Reserved.
//
// Unauthorized redistribution of this source code, in whole or part,
// without the express written permission of Swell Software
// is strictly prohibited.
//
// Notes:
//
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/

#ifndef PANIPRMT_HPP
#define PANIPRMT_HPP



typedef struct {
    PEGINT    BitmapId;
    PEGINT    FontId;
    PEGINT    ColorId;
    PEGINT    Delay;
    PEGINT    xOffset;
    PEGINT    yOffset;
    PEGINT    Disposal;     // 2 = Back fill, 0/1 = nothing, 4 = write prev
} PegAnimatedPromptFrame;



/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
class PegAnimatedPrompt : public PegPrompt
{
    public:
        PegAnimatedPrompt(const PegRect &Rect, PEGUINT StringId = 0,
                           PegAnimatedPromptFrame *pFrames = NULL,
                           PEGUSHORT Id = 0,
                           PEGULONG Style = FF_NONE|TJ_LEFT|AF_ENABLED);

        PegAnimatedPrompt(const PEGCHAR *pText, const PegRect &Rect,
                           PegAnimatedPromptFrame *pFrames = NULL,
                           PEGUSHORT Id = 0,
                           PEGULONG Style = TT_COPY|FF_NONE|TJ_LEFT|AF_ENABLED);

        PegAnimatedPrompt(const PegPoint &Put, PEGUINT StringId = 0,
                           PegAnimatedPromptFrame *pFrames = NULL,
                           PEGUSHORT Id = 0,
                           PEGULONG Style = FF_NONE|TJ_LEFT|AF_ENABLED,
                           PEGUINT FontId = 0);

        PegAnimatedPrompt(const PEGCHAR *pText, const PegPoint &Put,
                           PegAnimatedPromptFrame *pFrames = NULL,
                           PEGUSHORT Id = 0,
                           PEGULONG Style = TT_COPY|FF_NONE|TJ_LEFT|AF_ENABLED,
                           PEGUINT FontId = 0);

        virtual ~PegAnimatedPrompt();

        void AssignFrameList(PegAnimatedPromptFrame *pFrameList);

        virtual void Draw(const PegRect &Invalid);

        PEGINT GetCurrentFrame(void) {return mFrame;}

        virtual PEGINT Message(const PegMessage &Mesg);

        void SetCurrentFrame(PEGINT Frame);
        void SetMode(PEGUSHORT Mode);

        void StartFocus(void);
        void StartUnfocus(void);

    protected:
        void InitializeFrameList(PegAnimatedPromptFrame *pFrames);

        PegAnimatedPromptFrame *mpCurrentFrame;
        PegAnimatedPromptFrame *mpFrameList;

        PEGINT mFrame;
        PEGINT mNumFrames;
        PEGBOOL mRunning;
        PEGUSHORT mMode;

};





#endif

